package observer;

import java.lang.reflect.Method;
import java.util.Objects;

/**
 * @Description:
 * @Author: zhangh
 * @Time: 2020/12/21 20:56
 **/
public class Event {
    //事件源，发起者
    private Object source;
    //目标，需要通知谁
    private Object target;
    //回调
    private Method callback;
    //事件名称
    private String trigger;
    //发生事件
    private long time;

    public Event(Object target, Method method){
        this.target = target;
        this.callback = callback;
    }

    public void setTime(long currentTimeMillis) {
        this.time=currentTimeMillis;
    }

    public Event setSource(Object object) {
        this.source=object;
        return this;
    }

    public Method getCallBack() {
        return callback;
    }

    public Object getTarget() {
        return target;
    }
}
